<?php
/**
 * Interface for link builder classes
 *
 * Copyright (C) 2008  Sean Hickey
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * @author Sean Hickey <sean@headzoo.com>
 * @version $Id: Interface.php 392 2008-07-03 05:44:34Z sean $
 * @package Alinks_LinkBuilder
 */
interface Alinks_LinkBuilder_Interface
{
	/**
	 * Returns the link URI
	 *
	 * @return string
	 */
	function getUri();
	
	/**
	 * Returns the link inner text
	 *
	 * @return string
	 */
	function getText();
	
	/**
	 * Returns the classes attached to the link
	 *
	 * @return array
	 */
	function getClasses();
	
	/**
	 * Returns the link ID
	 *
	 * @return string
	 */
	function getId();
	
	/**
	 * Returns the link pre HTML strings
	 *
	 * @return array
	 */
	function getPreHtml();
	
	/**
	 * Returns the link post HTML strings
	 *
	 * @return array
	 */
	function getPostHtml();
	
	/**
	 * Returns the link args
	 *
	 * Returns the link args. If $arg is provided, then the value for
	 * that arg is returned instead of all the args.
	 *
	 * @param string $arg Argument key
	 * @return array|string
	 */
	function getArgs($arg = null);
	
	/**
	 * Returns the inner HTML
	 *
	 * The inner HTML is any arbitrary HTML that should go inside
	 * the anchor tag.
	 *
	 * @return string
	 */
	function getInnerHtml();
	
	/**
	 * Sets the link URI
	 *
	 * @param string $uri The link URI
	 * @return Alinks_LinkBuilder
	 */
	function setUri($uri);
	
	/**
	 * Sets the link inner text
	 *
	 * @param string $text The inner text
	 * @return Alinks_LinkBuilder
	 */
	function setText($text);
	
	/**
	 * Sets the link CSS classes
	 *
	 * @param array $classes Array of CSS classes
	 * @return Alinks_LinkBuilder
	 */
	function setClasses(array $classes);
	
	/**
	 * Adds a CSS class to the link
	 *
	 * @param string $class The class name
	 * @return Alinks_LinkBuilder
	 */
	function addClass($class);
	
	/**
	 * Sets the link ID
	 *
	 * @param string $id The link ID
	 * @return Alinks_LinkBuilder
	 */
	function setId($id);
	
	/**
	 * Sets the link pre HTML strings
	 *
	 * The pre HTML is any HTML that should come before the anchor tag
	 * HTML.
	 *
	 * @param array $pre_html The pre HTML strings
	 * @return Alinks_LinkBuilder
	 */
	function setPreHtml(array $pre_html);
	
	/**
	 * Adds a pre HTML string to the link
	 *
	 * The pre HTML is any HTML that should come before the anchor tag
	 * HTML.
	 *
	 * @param string $pre_html The pre HTML string
	 * @return Alinks_LinkBuilder
	 */
	function addPreHtml($pre_html);
	
	/**
	 * Sets the link post HTML strings
	 *
	 * The post HTML is any HTML that comes after the anchor tag
	 * HTML.
	 *
	 * @param array $post_html The post HTML strings
	 * @return Alinks_LinkBuilder
	 */
	function setPostHtml(array $post_html);
	
	/**
	 * Adds a post HTML string
	 *
	 * The post HTML is any HTML that comes after the anchor tag
	 * HTML.
	 *
	 * @param string $post_html The post HTML string
	 * @return Alinks_LinkBuilder
	 */
	function addPostHtml($post_html);
	
	/**
	 * Sets the link arguments
	 *
	 * @param array $args The arguments
	 * @param Alinks_LinkBuilder
	 */
	function setArgs(array $args);
	
	/**
	 * Adds an argument to the link
	 *
	 * @param string $key The argument key
	 * @param string $value The argument value
	 * @return Alinks_LinkBuilder
	 */
	function addArg($key, $value);
	
	/**
	 * Sets the inner HTML
	 *
	 * The inner HTML is any arbitrary HTML that should go inside
	 * the anchor tag.
	 *
	 * @param string $html The inner HTML
	 * @return Alinks_LinkBuilder
	 */
	function setInnerHtml($html);
	
	/**
	 * Returns the link HTML
	 *
	 * @return string
	 */
	function getHtml();
	
	/**
	 * Returns the link HTML
	 *
	 * @return string
	 */
	function __toString();
	
	/**
	 * Returns the link values as an array
	 *
	 * @return array
	 */
	function toArray();
}